package org.vic.observer.observer;

import java.util.Observable;

/**
 * Created by VIC.Huang on 2016/8/23.
 */
public class Writer extends Observable {
    private String name;    // 作者名
    private String lastNovel;       // 作者最新书名

    public Writer(String name) {
        super();
        this.name = name;
        WriterManager.getInstance().addWriter(this);
    }

    // ���߷������飬֪ͨ���й�ע�Ķ���
    public void addNovel(String novel) {
        System.out.println(name + "发布了新书《" + novel + "》");
        this.lastNovel = novel;
        setChanged();
        notifyObservers();
    }

    public String getName() {
        return name;
    }

    public String getLastNovel() {
        return lastNovel;
    }
}
